<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>

<script language="javascript" type="text/javascript">
function conMayusculas(field) {
    field.value = field.value.toUpperCase();
    alert("hola");
	}
</script>

</h:head>
<h:body>
<ui:composition template="/templates/Plantilla.xhtml">
 <ui:define name="content">
  <h:form>
  	 
  	 <p:messages id="messages" /> 
  	 
  	 <h3 style="text-align: center; padding-bottom:35px;"> Modificar de Vehiculo</h3> 
	 
	 <p:panel>	
		<h:panelGrid columns="3" columnClasses="label, value" styleClass="grid">		
						
			<h:outputLabel for="marca" value="Marca: *"/>		
			<p:inputText id="marca" value="#{vehiculoEdit.vehiculo.marca}" required = "true" label="Marca"/>
			<p:messages for="marca" ></p:messages>
		
			<h:outputLabel for="modelo" value="Modelo: *"/>		
			<p:inputText id="modelo" value="#{vehiculoEdit.vehiculo.modelo}" required = "true" label="Modelo"/>
			<p:messages for="modelo" ></p:messages>	
			
			<h:outputLabel for="patente" value="Patente: *"/>		
			<p:inputText id="patente" value="#{vehiculoEdit.vehiculo.patente}" required = "true" label="Patente"/>
			<p:messages for="patente" ></p:messages>	
			
			<h:outputLabel for="tipo" value="Tipo: *"/>		
			<p:inputText id="tipo" value="#{vehiculoEdit.vehiculo.tipo}" required = "true" label="Tipo"/>
			<p:messages for="tipo" ></p:messages>	
			
			<h:outputLabel for="numeroDeChasis" value="Nº Chasis: *"/>		
			<p:inputText id="numeroDeChasis" value="#{vehiculoEdit.vehiculo.numeroDeChasis}" required = "true"
				label ="Nº de Chasis"/>
			<p:messages for="numeroDeChasis" ></p:messages>
	
			<h:outputLabel for="numeroDeMotor" value="Nº Motor: *"/>		
			<p:inputText id="numeroDeMotor" value="#{vehiculoEdit.vehiculo.numeroDeMotor}" required = "true"
				label = "Nº de Motor"/>
			<p:messages for="numeroDeMotor" ></p:messages>
			
			<h:outputLabel for="combustible" value="Tipo de Combustible: *"/>		
			<p:selectOneMenu id="combustible" value="#{vehiculoEdit.vehiculo.combustible}" label="Tipo de Combustible" required = "true">
				<f:selectItems value="#{selectOneMany.getTipoCombustibles()}" />
			</p:selectOneMenu>
			<p:messages for="combustible" ></p:messages>
			
			<h:outputLabel for="valorDeVehiculo" value="Valor de Vehiculo: *"/>
			<p:inputText id="valorDeVehiculo" value="#{vehiculoEdit.vehiculo.valorDeVehiculo}" required = "true"
				label = "Valor de Vehiculo"/>
			<p:messages for="valorDeVehiculo" ></p:messages>
	
			<h:outputLabel for="numeroDePoliza" value="Nº Poliza: *"/>		
			<p:inputText id="numeroDePoliza" value="#{vehiculoEdit.vehiculo.numeroDePoliza}" required = "true"
				label = "Nº de Poliza"/>
			<p:messages for="numeroDePoliza" ></p:messages>

		</h:panelGrid>
	</p:panel>
	<p:panel style="text-align: center"  >
			<p:commandButton value="Guardar" id="guardar" title="Guardar Vehiculo" 
				action="#{vehiculoEdit.modificarVehiculo(vehiculoEdit.vehiculo)}" ajax = "false"
				icon="ui-icon-disk">	
			</p:commandButton>
			<p:commandButton value="Cancelar" action="#{vehiculoEdit.cancelar()}" ajax="false" immediate="true"
				icon="ui-icon-close"></p:commandButton>	
	</p:panel>
  </h:form>
 </ui:define>
</ui:composition>
</h:body>
</html>

